package com.hangxin.log.controller;

import com.hangxin.common.core.controller.BaseController;
import com.hangxin.common.core.domain.AjaxResult;
import com.hangxin.common.core.page.TableDataInfo;
import com.hangxin.log.domain.DocumentComparisonLog;
import com.hangxin.log.service.IDocumentComparisonLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;


/**
 * 文档对比分析日志 Controller
 *
 * @author ZX
 */
@RestController
@RequestMapping("/document/log")
public class DocumentComparisonLogController extends BaseController {

    @Autowired
    private IDocumentComparisonLogService documentComparisonLogService;

    @GetMapping("/list")
    public TableDataInfo list(DocumentComparisonLog documentComparisonLog) {
        startPage();
        List<DocumentComparisonLog> documentComparisonLogControllers = documentComparisonLogService.queryList(documentComparisonLog);
        return getDataTable(documentComparisonLogControllers);
    }

    @PutMapping
    public AjaxResult edit(@RequestBody DocumentComparisonLog documentComparisonLog) {
        return toAjax(documentComparisonLogService.updateById(documentComparisonLog));
    }

    /**
     * 删除学生信息
     */
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids) {
        return toAjax(documentComparisonLogService.removeByIds(Arrays.asList(ids)));
    }
}
